cmake_minimum_required(VERSION 3.5)

project(transcoder VERSION 0.1 LANGUAGES CXX)

# 源文件添加到该项目
add_executable(av_transcoder 
            "main.cpp" 
            "./XDecode/xdecode.cpp")

if(WIN32)
    # 预处理
    # add_definitions((-DGLOG_NO_ABBREVIATED_SEVERITIES))
    # 头文件目录
    INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/third_party/include")
    # INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/third_party/include")
    INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/third_party")

    target_link_directories(av_transcoder 
        PRIVATE ${PROJECT_SOURCE_DIR}/third_party/lib    
    )   

    # 添加dll库
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/out/build/x64-debug)
    file(GLOB dll_src "${PROJECT_SOURCE_DIR}/lib/*.dll")
    file(COPY ${dll_src} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

    # lib目录
    target_link_libraries(
    av_transcoder
    avcodec
    avdevice
    avfilter
    avformat
    avutil
    postproc
    swscale
    swresample
    )
endif()